home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / INRANGE.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  69 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _In_Range( ndInVar, ndInLow, ndInHigh ) --> lInRange
  8.  
  9. PARAMETERS:
  10.  
  11. ndIn_Var     Value to check
  12. ndIn_Low     Low Limit
  13. ndIn_High    High Limit
  14.  
  15. SHORT:
  16.  
  17. Determine if a numeric or date value is within a specified range.
  18.  
  19. DESCRIPTION:
  20.  
  21. _In_Range returns TRUE if ndIn_Var is greater than OR EQUAL TO ndIn_Low AND
  22. less than OR EQUAL TO ndIn_High.
  23.  
  24. _In_Range works on data types of date and numeric only.
  25.  
  26. The order of the hi/low ranges is not set in concrete.  They may be low to
  27. high or vice versa. That is, the High Range may contain the low value and the
  28. Low range may contain the High Value.  They values are manipulated as
  29. necessary to determine of the value is within this range regardless.
  30.  
  31. This is handy if you want to test a range for KEYSTROKE values, for instance,
  32. F2 - F10, where the order runs backward and you want to keep it simple in
  33. appearance. F2 - F10 would be -1 through -9 which makes them appear to run
  34. high to low rather than low to high when in actuality, that is the way
  35. negative numbers run.
  36.  
  37. NOTE:
  38.  
  39.  
  40.  
  41. EXAMPLE:
  42.  
  43. _In_Range(5,2,10)  // .T.
  44. _In_Range(5,10,2)  // .T.
  45. _In_Range(-5,-4,5) // .F.
  46.  
  47.  
  48. * Notice in the following the reversing of the hi/low ranges
  49.  
  50. t = 5
  51. logical1 = _In_Range(t,1,10)
  52. Result: logical1 = TRUE
  53.  
  54. logical2 = _In_Range(t,10,1)
  55. Result: logical2 = TRUE.
  56.  
  57.  
  58. t  = ctod('11/15/91')
  59. lo = ctod('11/01/91')
  60. hi = ctod('11/30/91')
  61.  
  62. logical3 = _In_Range(t,lo,hi)
  63. Result: logical3 = TRUE
  64.  
  65. logical4 = _In_Range(t,hi,low)
  66. Result: logical4 = TRUE
  67.  
  68. ******************************************************************************/
  69.